home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group93b.txt
/
000051_icon-group-sender _Wed Apr 28 13:56:23 1993.msg
< prev
next >
Wrap
Internet Message Format
|
1993-06-16
|
2KB
Received: by cheltenham.cs.arizona.edu; Mon, 3 May 1993 05:25:22 MST
Date: 28 Apr 93 13:56:23 GMT
From: mercury.hsi.com!mlfarm!cs.arizona.edu!icon-group@uunet.uu.net (Chris Tenaglia - 257-8765)
Organization: Medical College of Wisconsin (Milwaukee, WI)
Subject: Re: Help!
Message-Id: <01GXJCRBTCHU8WW7RY@mis.mcw.edu>
Sender: icon-group-request@cs.arizona.edu
To: icon-group@cs.arizona.edu
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
On Passing several variables In and several Out:
Structures and globals are the methods I use. Structures are better if
you have this as a widespread problem. Globals are useful in smaller
cases. I use globals a lot when converting a BASIC program into ICON.
----------------------------------------------------------------------
Method 1 : Use a structure
stuff := obtain(a,b,c)
...
# Using a List # Using a table
procedure obtain(a,b,c) or procedure obtain(a,b,c)
return [x,y,z] result := table("")
end result["x"] := 5*1.4
result["y"] := 22/7
result["z"] := ?25
return result
end
------------------------------------------------------------------------------
Method 2. Use globals
global x,y,z
procedure main()
...
obtain(a,b,c)
end
procedure obtain(a,b,c)
x := 5*1.3
y := 22/7
z := ?25
end
---------------------------------------------------------------------
Chris Tenaglia (System Manager) | "The past explained,
Medical College of Wisconsin | the future fortold,
8701 W. Watertown Plank Rd. | the present largely appologized for."
Milwaukee, WI 53226 | Organon to The Doctor
(414)257-8765 |
tenaglia@mis.mcw.edu